<?php
/**
 * SBTargetingCategory
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Sponsored Brands campaign management
 *
 * Create and manage Sponsored Brands campaigns.   To learn more about Sponsored Brands campaigns, see:   - [Sponsored Brands overview](guides/sponsored-brands/overview)  - [Sponsored Brands campaign structure](guides/sponsored-brands/campaigns/structure)  - [Get started with Sponsored Brands campaigns](guides/sponsored-brands/campaigns/get-started-with-campaigns)
 *
 * OpenAPI spec version: 4.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * SBTargetingCategory Class Doc Comment
 *
 * @category Class
 * @description Category details.
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class SBTargetingCategory implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'SBTargetingCategory';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'asin_count_range' => '\AmazonAdvertisingApi\Model\SBTargetingIntegerRange',
        'is_targetable' => 'bool',
        'parent_category_refinement_id' => 'string',
        'estimated_reach' => '\AmazonAdvertisingApi\Model\SBTargetingEstimatedReachRange',
        'name' => 'string',
        'translated_name' => 'string',
        'category_refinement_id' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'asin_count_range' => null,
        'is_targetable' => null,
        'parent_category_refinement_id' => null,
        'estimated_reach' => null,
        'name' => null,
        'translated_name' => null,
        'category_refinement_id' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'asin_count_range' => 'asinCountRange',
        'is_targetable' => 'isTargetable',
        'parent_category_refinement_id' => 'parentCategoryRefinementId',
        'estimated_reach' => 'estimatedReach',
        'name' => 'name',
        'translated_name' => 'translatedName',
        'category_refinement_id' => 'categoryRefinementId'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'asin_count_range' => 'setAsinCountRange',
        'is_targetable' => 'setIsTargetable',
        'parent_category_refinement_id' => 'setParentCategoryRefinementId',
        'estimated_reach' => 'setEstimatedReach',
        'name' => 'setName',
        'translated_name' => 'setTranslatedName',
        'category_refinement_id' => 'setCategoryRefinementId'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'asin_count_range' => 'getAsinCountRange',
        'is_targetable' => 'getIsTargetable',
        'parent_category_refinement_id' => 'getParentCategoryRefinementId',
        'estimated_reach' => 'getEstimatedReach',
        'name' => 'getName',
        'translated_name' => 'getTranslatedName',
        'category_refinement_id' => 'getCategoryRefinementId'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }



    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['asin_count_range'] = isset($data['asin_count_range']) ? $data['asin_count_range'] : null;
        $this->container['is_targetable'] = isset($data['is_targetable']) ? $data['is_targetable'] : null;
        $this->container['parent_category_refinement_id'] = isset($data['parent_category_refinement_id']) ? $data['parent_category_refinement_id'] : null;
        $this->container['estimated_reach'] = isset($data['estimated_reach']) ? $data['estimated_reach'] : null;
        $this->container['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['translated_name'] = isset($data['translated_name']) ? $data['translated_name'] : null;
        $this->container['category_refinement_id'] = isset($data['category_refinement_id']) ? $data['category_refinement_id'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets asin_count_range
     *
     * @return \AmazonAdvertisingApi\Model\SBTargetingIntegerRange
     */
    public function getAsinCountRange()
    {
        return $this->container['asin_count_range'];
    }

    /**
     * Sets asin_count_range
     *
     * @param \AmazonAdvertisingApi\Model\SBTargetingIntegerRange $asin_count_range asin_count_range
     *
     * @return $this
     */
    public function setAsinCountRange($asin_count_range)
    {
        $this->container['asin_count_range'] = $asin_count_range;

        return $this;
    }

    /**
     * Gets is_targetable
     *
     * @return bool
     */
    public function getIsTargetable()
    {
        return $this->container['is_targetable'];
    }

    /**
     * Sets is_targetable
     *
     * @param bool $is_targetable If the category is targetable or not.
     *
     * @return $this
     */
    public function setIsTargetable($is_targetable)
    {
        $this->container['is_targetable'] = $is_targetable;

        return $this;
    }

    /**
     * Gets parent_category_refinement_id
     *
     * @return string
     */
    public function getParentCategoryRefinementId()
    {
        return $this->container['parent_category_refinement_id'];
    }

    /**
     * Sets parent_category_refinement_id
     *
     * @param string $parent_category_refinement_id The category refinement id of the parent category. Missing parentCategoryRefinementId signifies this is a root category.
     *
     * @return $this
     */
    public function setParentCategoryRefinementId($parent_category_refinement_id)
    {
        $this->container['parent_category_refinement_id'] = $parent_category_refinement_id;

        return $this;
    }

    /**
     * Gets estimated_reach
     *
     * @return \AmazonAdvertisingApi\Model\SBTargetingEstimatedReachRange
     */
    public function getEstimatedReach()
    {
        return $this->container['estimated_reach'];
    }

    /**
     * Sets estimated_reach
     *
     * @param \AmazonAdvertisingApi\Model\SBTargetingEstimatedReachRange $estimated_reach estimated_reach
     *
     * @return $this
     */
    public function setEstimatedReach($estimated_reach)
    {
        $this->container['estimated_reach'] = $estimated_reach;

        return $this;
    }

    /**
     * Gets name
     *
     * @return string
     */
    public function getName()
    {
        return $this->container['name'];
    }

    /**
     * Sets name
     *
     * @param string $name Name of category.
     *
     * @return $this
     */
    public function setName($name)
    {
        $this->container['name'] = $name;

        return $this;
    }

    /**
     * Gets translated_name
     *
     * @return string
     */
    public function getTranslatedName()
    {
        return $this->container['translated_name'];
    }

    /**
     * Sets translated_name
     *
     * @param string $translated_name Translated name of the category.
     *
     * @return $this
     */
    public function setTranslatedName($translated_name)
    {
        $this->container['translated_name'] = $translated_name;

        return $this;
    }

    /**
     * Gets category_refinement_id
     *
     * @return string
     */
    public function getCategoryRefinementId()
    {
        return $this->container['category_refinement_id'];
    }

    /**
     * Sets category_refinement_id
     *
     * @param string $category_refinement_id The category refinement id. Please use /sb/targets/categories or /sb/recommendations/targets/category to retrieve category IDs.
     *
     * @return $this
     */
    public function setCategoryRefinementId($category_refinement_id)
    {
        $this->container['category_refinement_id'] = $category_refinement_id;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
